#pragma once
class CHash
{
    uint64 value;
    uint64 history[2048];
    uint hptr;
public:
    CHash();
    ~CHash();

    uint Reset()        
        { value = 0; hptr = 0; return 0; };
    uint64 Get( uint color, uint ep, uint flags );
    uint AddPiece( uint sq, uint piece );
    uint RemovePiece( uint sq, uint piece ) 
        { AddPiece(sq, piece); return 0; };
    uint Push() { 
        history[hptr] = value; 
        //cout << "hash = "<< (uint64) value << ", hptr = "<<hptr<<endl;
        hptr++; 
        return 0; };
    uint Pop()  { hptr--; value = history[hptr]; return 0; };
    uint IsRepetition( );
};

// todo - test it when hash pushes ans pops